package micotime.com.amap_plugin.map.interpolator;

import android.view.animation.Interpolator;

public class AccelerationInInterpolator implements Interpolator {
    private float input;
    public AccelerationInInterpolator(){}

    public AccelerationInInterpolator(float input){
        this.input = input;
    }
    @Override
    public float getInterpolation(float input) {
        // 模拟重加速度的interpolator
        if(input <= 0.5) {
            return (float) (0.5f - 2 * (0.5 - input) * (0.5 - input));
        } else {
            return (float) (0.5f - Math.sqrt((input - 0.5f)*(1.5f - input)));
        }
    }
}
